package testIntergration;

import static org.junit.Assert.*;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import FamilyTherapy.EventCard;
import FamilyTherapy.Player;
import FamilyTherapy.MagicToolCard;

public class testMagicToolCard_switchMT {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testSwitchMT_1() {
		
		class MagicToolCardStub extends MagicToolCard{
			@Override
			public int beDescisionMaker(int currentPlayerNo, Player p[])
			{
			// a simple implementation,
			// which is specially designed for our test case: (5, 1, 1)
			return 1;
			}
		}
		Player[] p ={new Player("a",1),new Player("b",2)};
		MagicToolCard m = new MagicToolCardStub();
		EventCard e = new EventCard(0);	
		int result= m.switchMT(0,e,1,1,p,1);
	
		assertEquals(result, 1);	
	}
	@Test
	public void testSwitchMT_2() {		

		class MagicToolCardStub extends MagicToolCard{
			@Override
			public int noDeduction()
			{
			// a simple implementation,
			// which is specially designed for our test case: (5, 1, 1)
			return -1;
			}
		}
		Player[] p ={new Player("a",1),new Player("b",2)};
		MagicToolCard m = new MagicToolCardStub();
		EventCard e = new EventCard(0);	

		int result= m.switchMT(1,e,1,1,p,1);
		

		assertEquals(result, -1);	
	}
	@Test
	public void testSwitchMT_3() {		

		class MagicToolCardStub extends MagicToolCard{
			@Override
			public int noDeuctionAsFeeling() 
			{
			// a simple implementation,
			// which is specially designed for our test case: (5, 1, 1)
			return -1;
			}
		}
		Player[] p ={new Player("a",1),new Player("b",2)};
		MagicToolCard m = new MagicToolCardStub();
		EventCard e = new EventCard(0);	

		int result= m.switchMT(2,e,1,1,p,1);

		assertEquals(result, -1);	
	}
	@Test
	public void testSwitchMT_4() {
		class MagicToolCardStub extends MagicToolCard{
			@Override
			public int noDeductionAsRebound(EventCard currentEvent, int choice, int decisionMakerNo, Player p[])
			{
			// a simple implementation,
			// which is specially designed for our test case: (5, 1, 1)
			return -1;
			}
		}
		Player[] p ={new Player("a",1),new Player("b",2)};
		MagicToolCard m = new MagicToolCardStub();
		EventCard e = new EventCard(0);	

		int result= m.switchMT(3,e,1,1,p,1);
			
		assertEquals(result, -1);	
	}
	@Test
	public void testSwitchMT_5() {
		class MagicToolCardStub extends MagicToolCard{
			@Override
			public int assignDescisionMaker(EventCard currentEvent, int currentPlayerNo, Player p[]) 
			{
			// a simple implementation,
			// which is specially designed for our test case: (5, 1, 1)
			return 1;
			}
		}
		Player[] p ={new Player("a",1),new Player("b",2)};
		MagicToolCard m = new MagicToolCardStub();
		EventCard e = new EventCard(0);	

		int result= m.switchMT(4,e,1,1,p,1);
		
		assertEquals(result, 1);	
	}
	@Test
	public void testSwitchMT_6() {
		Player[] p ={new Player("a",1),new Player("b",2)};
		MagicToolCard m = new MagicToolCard();
		EventCard e = new EventCard(0);	
		int result= m.switchMT(5,e,1,1,p,1);
		
		
		assertEquals(result, 1);	
	}
	
}

